package com.codoon.unova.util;

import java.io.File;

import android.content.Context;
import android.os.Environment;

public class FilePathConstants {

	/* 获取SD卡目录 */
	private static final String SD_FILE_PATH = Environment
			.getExternalStorageDirectory().getAbsolutePath();
	private static final String Photo_IMG_PATH = SD_FILE_PATH + File.separator
			+ "codoonsports" + File.separator + "photos";
	private static final String SOFRWARE_DOWNLOAD_PATH = SD_FILE_PATH
			+ File.separator + "codoonsports" + File.separator + "apk";

	// 获取保存压缩图片的路径
	public static String getZipPhotosPath(Context context) {
		File path;
		if (Environment.getExternalStorageState().equals(
				Environment.MEDIA_MOUNTED)) {
			path = new File(Photo_IMG_PATH + File.separator + "zip");
		} else {
			String appPath = context.getApplicationContext().getFilesDir()
					.getAbsolutePath();
			path = new File(appPath + File.separator + "photos"
					+ File.separator + "zip");
		}
		if (!path.exists()) {
			path.mkdirs();
		}

		return path.getAbsolutePath();
	}

	// 获取保存压缩图片的路径
	public static String getHeadPhotosPath(Context context) {
		File path;
		if (Environment.getExternalStorageState().equals(
				Environment.MEDIA_MOUNTED)) {
			path = new File(Photo_IMG_PATH + File.separator + "avater");
		} else {
			String appPath = context.getApplicationContext().getFilesDir()
					.getAbsolutePath();
			path = new File(appPath + File.separator + "photos"
					+ File.separator + "avater");
		}
		if (!path.exists()) {
			path.mkdirs();
		}

		return path.getAbsolutePath();
	}

	public static String getSharePhotosPath(Context context) {

		File path;
		if (Environment.getExternalStorageState().equals(
				Environment.MEDIA_MOUNTED)) {
			path = new File(Photo_IMG_PATH + File.separator + "share");
		} else {
			String appPath = context.getApplicationContext().getFilesDir()
					.getAbsolutePath();
			path = new File(appPath + File.separator + "photos"
					+ File.separator + "share");
		}
		if (!path.exists()) {
			path.mkdirs();
		}

		return path.getAbsolutePath();
	}

	public static String getAvatarPhotosPath(Context context) {
		File path;
		if (Environment.getExternalStorageState().equals(
				Environment.MEDIA_MOUNTED)) {
			path = new File(Photo_IMG_PATH + File.separator + "avater");
		} else {
			String appPath = context.getApplicationContext().getFilesDir()
					.getAbsolutePath();
			path = new File(appPath + File.separator + "photos"
					+ File.separator + "avater");
		}
		if (!path.exists()) {
			path.mkdirs();
		}

		return path.getAbsolutePath();
	}

	public static String getSoftwareDownloadPath() {
		File path = new File(SOFRWARE_DOWNLOAD_PATH);
		if (!path.exists()) {
			path.mkdirs();
		}
		return path.getAbsolutePath();
	}
	
	// 获取保存压缩图片的路径
	public static String getAdvPhotosPath(Context context) {
		File path;
		if (Environment.getExternalStorageState().equals(
				Environment.MEDIA_MOUNTED)) {
			path = new File(Photo_IMG_PATH + File.separator + "adv");
		} else {
			String appPath = context.getApplicationContext().getFilesDir()
					.getAbsolutePath();
			path = new File(appPath + File.separator + "photos"
					+ File.separator + "adv");
		}
		if (!path.exists()) {
			path.mkdirs();
		}

		return path.getAbsolutePath();
	}

}
